import wxRequest from '../utils/wxRequest'
import appConfig from '../utils/appConfig'
wxRequest.baseurl = `${appConfig.HTTP_BAST_URL}api/public/v1`
// 获取主页轮播图数据
const getHomeSwipe = params => {
  return wxRequest('/home/swiperdata', params).then(res => res.data)
};
// 获取首页分类数据选项
const getHomeNav = params => {
  return wxRequest('/home/catitems', params).then(res => res.data)
};
// 获取楼层有关数据
const getfloorData = params => {
  return wxRequest('/home/floordata').then(res => res.data)
};
// 获取分类数据
const getCategory = params => {
  return wxRequest('/categories').then(res => res.data)
};
// 获取商品详情数据
const getGoodsDetail = params => {
  return wxRequest('/goods/detail', params).then(res => res.data)
};
// 用户登录请求
const checkLogin = params => {
  return wxRequest('/users/wxlogin', params).then(res => res.data)
};
export default {
  getHomeSwipe,
  getHomeNav,
  getfloorData,
  getCategory,
  getGoodsDetail,
  checkLogin
}
